home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / CoinDrain.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  874 b   |  36 lines

  1. class classes.fx.CoinDrain
  2. {
  3.    var x;
  4.    var y;
  5.    var id;
  6.    var clip;
  7.    var xMov;
  8.    var yMov;
  9.    var Name = "coinDrain";
  10.    function CoinDrain(px, py, pid)
  11.    {
  12.       this.x = px;
  13.       this.y = py;
  14.       this.id = pid;
  15.       _root.d = _root.d + 1;
  16.       this.clip = _root.attachMovie("coinDrain","coinDrain" + this.id + "Clip",_root.d + 499990);
  17.       this.clip._x = this.x;
  18.       this.clip._y = this.y;
  19.       this.clip._alpha = 40;
  20.       this.xMov = _root.randRange2(-3,3);
  21.       this.yMov = _root.randRange2(-2,-5);
  22.    }
  23.    function main()
  24.    {
  25.       this.clip._alpha -= 0.5;
  26.       if(this.x > 1050 || this.x < -50 || this.y < -50 || this.y > 650)
  27.       {
  28.          _root.removeFX("coinDrain" + this.id);
  29.       }
  30.       this.x += this.xMov;
  31.       this.y += this.yMov;
  32.       this.clip._x = this.x;
  33.       this.clip._y = this.y;
  34.    }
  35. }
  36.